;var module = angular.module('CtrlsContent');
module.controller('TikubuyCtrl',['$scope','api_other','$stateParams','weixinbuy_service',function($scope,api_other,$stateParams,weixinbuy_service){
	$scope.price = 0;
	$scope.title = localStorage.bls_catname;
	$scope.event = {
		get:function(){
			var obj = {
				catId:localStorage.catId,
				type:1
			};
			var promise = api_other.timugoumai(obj);
			promise.success(function(data){
				if(data.returnCode == 0){
					$scope.price = data.returnData.price;
				}
			})
		},
		submit:function(){
			var obj = {
				catId:localStorage.catId,
				userId:localStorage.bls_userId
			};
			var promise = api_other.tikudingdan(obj);
			promise.success(function(data){
				if(data.returnCode == 0){
					var orderId = data.returnData.orderId;
					weixinbuy_service.submit(orderId,4);
				}
			})
		}
	};
	$scope.event.get();
}])